home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Magazine 28 Bonus
/
CDRomMagazine-SoftKey-ArtPassion-FrenchVersion-Win31Mac.bin
/
data
/
crcolpl.dir
/
00100_Script_SQUARE GAME
< prev
next >
Wrap
Text File
|
1996-05-03
|
5KB
|
161 lines
-- --------------------------------------------------
-- Handler changeSquareColor changes the color of the sprites
-- in the given spriteList to a random color if the
-- user did not choose a color from the pallete and
-- to the selected color if the user chose a color
-- from the pallete.
on changeSquareColor spriteList
global palleteFlag, color
if palleteFlag = FALSE then
set color = random(255)
end if
repeat with i = 1 to count(spriteList)
set theSprite = getAt(spriteList,i)
set the backColor of sprite theSprite = value(color)
set the foreColor of sprite theSprite = value(color)
end repeat
set palleteFlag = FALSE
updateStage
end
-- --------------------------------------------------
-- Handler setColor sets the color to the color the
-- user chose from the pallete and sets the global
-- variable palleteFlag to TRUE so changeColor
-- will use the chosen color and not a random color.
on setColor clickedSprite
global color, pointerHeight, palleteFlag, arrowSprite
set palleteFlag = TRUE
set color = the name of cast the castNum of sprite clickedSprite
set pointerLoc = the left of sprite clickedSprite + (the width of sprite clickedSprite / 2)
set the locH of sprite arrowSprite = pointerLoc
updateStage
end
-- --------------------------------------------------
-- Handler setArrowSprite sets the sprite of the
-- arrow used in the square game.
on setArrowSprite
global arrowSprite
set arrowSprite = 37
end
-- --------------------------------------------------
-- Handler setSquareSprites sets the sprites of the
-- squares
on setSquareSprites
global rightSquare, leftSquare, little1, little2
set leftSquare = 3
set rightSquare = 4
set little1 = 5
set little2 = 6
end
-- --------------------------------------------------
-- Handler setSquareGamePuppets sets the puppets of the
-- squares and the arrow to true
on setSquareGamePuppets val
global rightSquare, leftSquare, little1, little2, arrowSprite
puppetSprite rightSquare, val
puppetSprite leftSquare, val
puppetSprite little1, val
puppetSprite little2, val
puppetSprite arrowSprite, val
end
-- --------------------------------------------------
-- Handler setInSquareGame is called when the user
on setInSquareGame val
global inSquareGame
set inSquareGame = val
end
-- --------------------------------------------------
-- Handler initializeColor initializes the global
-- variable color to white.
on initializeColor
global color
set color = 0
end
-- --------------------------------------------------
-- Handler initializePalleteFlag initializes the global
-- variable palleteFlag to FALSE.
on initializePalleteFlag
global palleteFlag
set palleteFlag = FALSE
end
-- --------------------------------------------------
-- Handler initializeSquareGame sets the game ready to be
-- played.
on initializeSquareGame
-- preloadSquareGameCasts
setInSquareGame(TRUE)
setSquareSprites
setArrowSprite
setSquareGamePuppets(TRUE)
initializeColor
initializePalleteFlag
end
-- --------------------------------------------------
-- Handler endSquareGame is called when the user
-- quits playing the square game. It turns off the
-- puppets set in the game.
on endSquareGame
setSquareGamePuppets(FALSE)
setInSquareGame(FALSE)
end
-- --------------------------------------------------
-- Handler preloadSquareGameCasts
--on preloadSquareGameCasts
-- waitCursor
-- preLoadCast the number of cast "5"
-- preLoadCast the number of cast "149"
-- preLoadCast the number of cast "125"
-- preLoadCast the number of cast "188"
-- preLoadCast the number of cast "157"
-- preLoadCast the number of cast "150"
-- preLoadCast the number of cast "144"
-- preLoadCast the number of cast "79"
-- preLoadCast the number of cast "12"
-- preLoadCast the number of cast "0"
-- preLoadCast the number of cast "37"
-- preLoadCast the number of cast "2"
-- preLoadCast the number of cast "44"
-- preLoadCast the number of cast "51"
-- preLoadCast the number of cast "15"
-- preLoadCast the number of cast "58"
-- preLoadCast the number of cast "250"
-- preLoadCast the number of cast "99"
-- preLoadCast the number of cast "135"
-- preLoadCast the number of cast "208"
-- preLoadCast the number of cast "239"
-- preLoadCast the number of cast "204"
-- preLoadCast the number of cast "132"
-- preLoadCast the number of cast "67"
-- preLoadCast the number of cast "34"
-- preLoadCast the number of cast "35"
-- preLoadCast the number of cast "217"
-- preLoadCast the number of cast "179"
-- preLoadCast the number of cast "255"
-- normalCursor
--end